.class public abstract Lcom/kwad/sdk/core/g/c;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/kwad/sdk/core/g/c$a;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Lcom/kwad/sdk/core/g/d;",
        "R::",
        "Lcom/kwad/sdk/core/network/f;",
        ">",
        "Ljava/lang/Object;"
    }
.end annotation


# static fields
.field private static e:Ljava/util/concurrent/ExecutorService;


# instance fields
.field private volatile a:J

.field private b:Lcom/kwad/sdk/core/g/i;

.field private c:Landroid/os/HandlerThread;

.field private d:Landroid/os/Handler;

.field private f:Landroid/content/Context;

.field private g:Ljava/util/concurrent/atomic/AtomicInteger;


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method protected constructor <init>()V
    .locals 8

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/32 v0, 0x1d4c0

    iput-wide v0, p0, Lcom/kwad/sdk/core/g/c;->a:J

    new-instance v0, Lcom/kwad/sdk/core/g/j;

    invoke-direct {v0}, Lcom/kwad/sdk/core/g/j;-><init>()V

    iput-object v0, p0, Lcom/kwad/sdk/core/g/c;->b:Lcom/kwad/sdk/core/g/i;

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/kwad/sdk/core/g/c;->c:Landroid/os/HandlerThread;

    iput-object v0, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V

    iput-object v0, p0, Lcom/kwad/sdk/core/g/c;->g:Ljava/util/concurrent/atomic/AtomicInteger;

    sget-object v0, Lcom/kwad/sdk/core/g/c;->e:Ljava/util/concurrent/ExecutorService;

    if-nez v0, :cond_0

    new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;

    const/4 v2, 0x1

    const/4 v3, 0x1

    const-wide/16 v4, 0x0

    sget-object v6, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    new-instance v7, Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-direct {v7}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V

    move-object v1, v0

    invoke-direct/range {v1 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V

    sput-object v0, Lcom/kwad/sdk/core/g/c;->e:Ljava/util/concurrent/ExecutorService;

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/kwad/sdk/core/g/c;)Landroid/os/Handler;
    .locals 0

    iget-object p0, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    return-object p0
.end method

.method static synthetic a(Lcom/kwad/sdk/core/g/c;J)V
    .locals 0

    invoke-direct {p0, p1, p2}, Lcom/kwad/sdk/core/g/c;->b(J)V

    return-void
.end method

.method static synthetic b(Lcom/kwad/sdk/core/g/c;)J
    .locals 2

    iget-wide v0, p0, Lcom/kwad/sdk/core/g/c;->a:J

    return-wide v0
.end method

.method private b(J)V
    .locals 5

    iget-object v0, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    const v1, 0x1010111

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    iget-object v0, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    new-instance v2, Lcom/kwad/sdk/core/g/c$a;

    iget-object v3, p0, Lcom/kwad/sdk/core/g/c;->f:Landroid/content/Context;

    iget-object v4, p0, Lcom/kwad/sdk/core/g/c;->b:Lcom/kwad/sdk/core/g/i;

    invoke-direct {v2, p0, v3, v4}, Lcom/kwad/sdk/core/g/c$a;-><init>(Lcom/kwad/sdk/core/g/c;Landroid/content/Context;Lcom/kwad/sdk/core/g/i;)V

    invoke-static {v0, v2}, Landroid/os/Message;->obtain(Landroid/os/Handler;Ljava/lang/Runnable;)Landroid/os/Message;

    move-result-object v0

    iput v1, v0, Landroid/os/Message;->what:I

    iget-object v1, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    invoke-virtual {v1, v0, p1, p2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    return-void
.end method

.method static synthetic c(Lcom/kwad/sdk/core/g/c;)Lcom/kwad/sdk/core/g/i;
    .locals 0

    iget-object p0, p0, Lcom/kwad/sdk/core/g/c;->b:Lcom/kwad/sdk/core/g/i;

    return-object p0
.end method

.method private d()Z
    .locals 5

    iget-object v0, p0, Lcom/kwad/sdk/core/g/c;->b:Lcom/kwad/sdk/core/g/i;

    invoke-interface {v0}, Lcom/kwad/sdk/core/g/i;->a()J

    move-result-wide v0

    invoke-static {}, Lcom/kwad/sdk/core/a/b;->d()I

    move-result v2

    int-to-long v2, v2

    cmp-long v4, v0, v2

    if-ltz v4, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method static synthetic d(Lcom/kwad/sdk/core/g/c;)Z
    .locals 0

    invoke-direct {p0}, Lcom/kwad/sdk/core/g/c;->d()Z

    move-result p0

    return p0
.end method

.method static synthetic e(Lcom/kwad/sdk/core/g/c;)Ljava/util/concurrent/atomic/AtomicInteger;
    .locals 0

    iget-object p0, p0, Lcom/kwad/sdk/core/g/c;->g:Ljava/util/concurrent/atomic/AtomicInteger;

    return-object p0
.end method


# virtual methods
.method public a()V
    .locals 2

    const-wide/16 v0, 0x0

    invoke-direct {p0, v0, v1}, Lcom/kwad/sdk/core/g/c;->b(J)V

    return-void
.end method

.method protected a(J)V
    .locals 3

    const-wide/16 v0, 0x3c

    cmp-long v2, p1, v0

    if-gez v2, :cond_0

    const-wide/32 p1, 0xea60

    goto :goto_0

    :cond_0
    const-wide/16 v0, 0x3e8

    mul-long p1, p1, v0

    :goto_0
    iput-wide p1, p0, Lcom/kwad/sdk/core/g/c;->a:J

    return-void
.end method

.method public a(Landroid/content/Context;)V
    .locals 1

    iput-object p1, p0, Lcom/kwad/sdk/core/g/c;->f:Landroid/content/Context;

    new-instance p1, Landroid/os/HandlerThread;

    invoke-virtual {p0}, Lcom/kwad/sdk/core/g/c;->c()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p1, v0}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    iput-object p1, p0, Lcom/kwad/sdk/core/g/c;->c:Landroid/os/HandlerThread;

    invoke-virtual {p1}, Landroid/os/HandlerThread;->start()V

    new-instance p1, Landroid/os/Handler;

    iget-object v0, p0, Lcom/kwad/sdk/core/g/c;->c:Landroid/os/HandlerThread;

    invoke-virtual {v0}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-direct {p1, v0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    iput-object p1, p0, Lcom/kwad/sdk/core/g/c;->d:Landroid/os/Handler;

    return-void
.end method

.method public a(Lcom/kwad/sdk/core/g/h;)V
    .locals 2
    .param p1    # Lcom/kwad/sdk/core/g/h;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/kwad/sdk/core/g/h<",
            "TT;>;)V"
        }
    .end annotation

    sget-object v0, Lcom/kwad/sdk/core/g/c;->e:Ljava/util/concurrent/ExecutorService;

    new-instance v1, Lcom/kwad/sdk/core/g/c$1;

    invoke-direct {v1, p0, p1}, Lcom/kwad/sdk/core/g/c$1;-><init>(Lcom/kwad/sdk/core/g/c;Lcom/kwad/sdk/core/g/h;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method protected a(Lcom/kwad/sdk/core/g/i;)V
    .locals 0

    iput-object p1, p0, Lcom/kwad/sdk/core/g/c;->b:Lcom/kwad/sdk/core/g/i;

    return-void
.end method

.method protected a(Ljava/util/List;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "TT;>;)V"
        }
    .end annotation

    if-eqz p1, :cond_0

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/kwad/sdk/core/g/c;->g:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->getAndIncrement()I

    new-instance v0, Lcom/kwad/sdk/core/g/c$2;

    invoke-direct {v0, p0, p1}, Lcom/kwad/sdk/core/g/c$2;-><init>(Lcom/kwad/sdk/core/g/c;Ljava/util/List;)V

    new-instance v1, Lcom/kwad/sdk/core/g/c$3;

    invoke-direct {v1, p0, p1}, Lcom/kwad/sdk/core/g/c$3;-><init>(Lcom/kwad/sdk/core/g/c;Ljava/util/List;)V

    invoke-virtual {v0, v1}, Lcom/kwad/sdk/core/network/h;->a(Lcom/kwad/sdk/core/network/g;)V

    :cond_0
    return-void
.end method

.method protected abstract b(Ljava/util/List;)Lcom/kwad/sdk/core/network/f;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "TT;>;)TR;"
        }
    .end annotation
.end method

.method protected b()V
    .locals 2

    iget-wide v0, p0, Lcom/kwad/sdk/core/g/c;->a:J

    invoke-direct {p0, v0, v1}, Lcom/kwad/sdk/core/g/c;->b(J)V

    return-void
.end method

.method protected abstract c()Ljava/lang/String;
.end method
